#ifndef _STATS_H_
# define _STATS_H_

#include <time.h>
#include "list_model.h"

#define CHART_SAMPLES 30
#define STAT_SAMPLE_RATE 5

typedef struct _user_information {
	char *site;
	char *referer;
	char *entry;
	char *time;
	int   path;
	long  accesses;
} userInfo;

typedef struct _graph_information {
	int fixme; // use the graphframe instead ?
} graphInfo;

typedef struct _stat_storage {
	long samples;
	int  refreshRate;
	pthread_mutex_t mutex;

	userInfo **UserInfo;
	long UserInfoLen;

	char **UserList;
	long UserListLen;

} statStorage;

void *
thread_update_stats(void *arg);

void
init_stat_data(statStorage *data);

void
updateInterface(GtkWidget *app, statStorage *data);

void
updateStats(w3lclient *client,statStorage *data);

void
SetPathInfo(w3lclient *client, GtkWidget *app, char *username);

#endif
